
function getPickerValue(targetObj, id) {
  for (let index in targetObj) {
    if (targetObj[index].siteId == id) {
      return index
    }
  }

}
function formatTime(date, isStart) {
  var year = date.getFullYear()
  var month = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
  var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();

  if (isStart == true) {
    return year + '-' + month + '-' + '01'
  }
  return year + '-' + month + '-' + day
}
module.exports = {
  getPickerValue,
  formatTime

}